#ifndef __DSTH_I_REACTOR_H__
#define __DSTH_I_REACTOR_H__

#include <vector>
#include <map>
#include "Timestamp.h"

namespace dsth {

class Channel;
class IMultiplex {
public:
    typedef std::vector<Channel*> ChannelList;
    typedef std::map<int, Channel*> ChannelMap;
    virtual ~IMultiplex() {}
    virtual void UpdateChannel(Channel* channel) = 0;
    virtual void RemoveChannel(Channel* channel) = 0;
    virtual Timestamp Run(int time_out, ChannelList* active_list) = 0;
    ChannelMap channel_map_;
};

extern IMultiplex* CreateMultiplexor();

} // namespace
#endif // __DSTH_I_REACTOR_H__
